#!/bin/sh

IMAGE=codercom/code-server
NEW_IMAGE=ghcr.io/frost-tb-voo/code-server-go
DIR=$(cd $(dirname ${BASH_SOURCE:-$0}); pwd)
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
cd ${DIR}
docker pull node:12
docker pull golang:buster
docker pull ${IMAGE}
docker build -t ${NEW_IMAGE} \
 --build-arg VCS_REF=`git rev-parse --short HEAD` \
 .
docker tag ${NEW_IMAGE} ${NEW_IMAGE}:local
docker images ${NEW_IMAGE}

